#ifndef _PluginGLRenderSystem_h_
#define _PluginGLRenderSystem_h_

#include "BlazePluginGLConfig.h"

#include "BlazeEngineRenderSystem.h"
#include "BlazePluginGLTexture.h"

class BeGLRenderSystem : public BeRenderSystem
{
public:
	BeGLRenderSystem();
	virtual ~BeGLRenderSystem();

	static LRESULT CALLBACK WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam);

	virtual bool InstallRenderWindow(int iWindowHandle, const char* pcTilte = NULL);
	virtual void UninstallRenderWindow();

	virtual bool Install();
	virtual void Uninstall();
	virtual void MessageLoop();

	virtual void SetActive(bool bActive);
	virtual void SetFullscreen(bool bFullscreen);
	virtual void SetBits(int iBits);
	virtual void SetWindowLeft(int iLeft);
	virtual void SetWindowTop(int iTop);
	virtual void SetWindowWidth(int iWidth);
	virtual void SetWindowHeight(int iHeight);

	virtual bool IsActive();
	virtual bool IsFullscreen();
	virtual int GetBits();
	virtual int GetWindowHandle();
	virtual int GetWindowLeft();
	virtual int GetWindowTop();
	virtual int GetWindowWidth();
	virtual int GetWindowHeight();

	virtual bool BeginRender(BeColor Color, bool bZBuffer = true);
	virtual bool EndRender();

	virtual void SetFog(FogType Type, BeColor Color, float fDensity, float fStart, float fEnd);
	virtual void SetTexture(unsigned int uiUnit, BeTexture* pTexture);

private:

	HDC			m_hDC;
	HGLRC		m_hRC;
	HWND		m_hWnd;
	HINSTANCE	m_hInstance;
	char		m_szTitle[128];
};

#endif
